System and method for rendering a texture map utilizing an illumination modulation value

ABSTRACT

In one embodiment, the present invention is directed to a system for rendering a pixel of a digital image. The system may comprise a texture map data structure representing a texture map of a plurality of texels; the texture map structure comprising a plurality of coefficients for each texel of the texture map; the plurality of coefficients defining lighting characteristics of the respective texel in response to illumination in a plane. The system may further comprise a modulation data structure; the modulation data structure defining a range of values associated with an illumination vector. Additionally, the system may comprise a rendering algorithm; the rendering algorithm operable to calculate a texel display value using the texture map data structure; the rendering algorithm operable to determine an illumination modulation value from the modulation data structure; and the rendering algorithm being operable to multiply the texel display value by the illumination modulation value to render a pixel.

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] The present invention is related to co-pending and commonly assigned U.S. Patent Application Ser. No. 09/528,700, entitled “APPARATUS FOR AND METHOD OF RENDERING 3D OBJECTS WITH PARAMETRIC TEXTURE MAPS,” and co-pending and commonly assigned U.S. patent application Ser. No.______,entitled “SYSTEM AND METHOD FOR SYNTHESIS OF PARAMETRIC TEXTURE MAP TEXTURES,” which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

[0002] 1. Technical Field

[0003] The present invention is related to computer graphics processing and more particularly to a system and method for rendering a texture map utilizing an illumination modulation value.

[0004] 2. Background

[0005] Various techniques have been utilized to render graphical images via computer systems. One technique that has received appreciable attention is texture mapping. A texture refers to a graphics data structure which models the surface appearance of an object. A texture may represent the visual experience of many materials and substances (e.g., terrain, plants, minerals, fur, and skin). Textures may be created digitally by sampling a physical surface utilizing photographic techniques. Alternatively, textures may be created manually utilizing a suitable graphics design application. Texture mapping involves mapping the surface appearance to a graphical surface modeled by a three-dimensional structure.

[0006] Texture mapping may be utilized for any number of applications. For example, texture mapping may be utilized by an architectural software application to generate a realistic depiction of a building based upon blueprint designs. For example, a stucco texture may be wrapped onto a building frame by the architectural software application. Texture mapping may be additionally used to create special effects for movies, video game animation, website wallpapers, and/or the like. Texture mapping is desirable for these applications, because it facilitates the representation of an object with an appreciable amount of realism and detail. Moreover, texture mapping imparts three-dimensional qualities to the computer generated image.

[0007] Texture mapping algorithms involve wrapping a texture over the surface of a model. Specifically, a three-dimensional model or data structure of an object is created. For example, FIG. 1A depicts exemplary object 101 in three-dimensional real space (R₃). The surface of object 101 may be represented as a set of polygons (typically triangles) in three-dimensional space. The polygons are represented by their various vertexes. The vertexes are defined by coordinates in three-dimensional real space (R₃). For example, vertex 102 is defined by (x₁, y₁, z₁) and vertex 103 is defined by (x₂, y₂, z₂)

[0008] However, most computer displays are only capable of displaying graphical images in two dimensions. Accordingly, a mapping function is utilized to map the coordinates in three-dimensional real space (R₃) to coordinates in two-dimensional real space (R₂). Typically, the mapping occurs by defining a view angle. FIG. 1B depicts such a mapping from object 101 of FIG. 1A to object 104. Vertex 102 is mapped to vertex 105 where vertex 105 is defined by two coordinates (x₃, y₃). Likewise, vertex 103 is mapped to vertex 106 where vertex 106 is defined by two coordinates (x₄, y₄). The mapping function allows the data to be represented in a form that may be displayed by a computer display.

[0009] Concurrently with the mapping, a texture is applied within the confines of the polygons of object 104 to provide a realistic appearance. For example, texture 201 of FIG. 2 may be applied to the polygons of object 104 to create a stone-like appearance. Texture 201 is typically implemented as a matrix of red, green, and blue (RGB) values. The RGB values are mapped utilizing a suitable mapping function to the interior of the polygons of object 104. The final graphical image appears to have texture 201 “wrapped” around object 104.

[0010] However, this approach is limited as the final graphical image, to an extent, appears flat. Specifically, the graphical image does not appreciably vary in response to a change in illumination direction. Since it does not appreciably change under these conditions, localized shading or occlusions are not evident. Moreover, interreflections due to surface irregularities are not perceived.

[0011] Bump mapping is a technique to address these limitations. Bump mapping involves creating a bump map of displacement values. The displacement values are utilized to perturb the surface normal vector. The perturbed surface normal vector is utilized to rendering shading in accordance with the Blinn/Phong lighting equation. Although bump mapping techniques do provide optical effects that are not present in RGB texture mapping techniques, the degree of realism produced by bump maps is limited. Moreover, bump mapping is problematic, because the creation of the displacement values may, particularly from actual samples, be cumbersome.

BRIEF SUMMARY OF THE INVENTION

[0012] In one embodiment, the present invention is directed to a system for rendering a pixel of a digital image. The system may comprise a texture map data structure representing a texture map of a plurality of texels; the texture map structure comprising a plurality of coefficients for each texel of the texture map; the plurality of coefficients defining lighting characteristics of the respective texel in response to illumination in a plane. The system may further comprise a modulation data structure; the modulation data structure defining a range of values associated with an illumination vector. Additionally, the system may comprise a rendering algorithm; the rendering algorithm operable to calculate a texel display value using the texture map data structure; the rendering algorithm operable to determine an illumination modulation value from the modulation data structure; and the rendering algorithm being operable to multiply the texel display value by the illumination modulation value to render a pixel.

BRIEF DESCRIPTION OF THE DRAWINGS

[0013]FIG. 1A depicts an exemplary object in R₃ according to the prior art.

[0014]FIG. 1B depicts an exemplary mapping of polygons into R₂ based on the object depicted in FIG. 1 according to the prior art.

[0015]FIG. 2 depicts an exemplary texture according to the prior art.

[0016]FIG. 3 depicts an exemplary plane associated with a texel, surface normal vector, and an illumination vector.

[0017]FIG. 4A depicts an exemplary mapping function according to an embodiment of the present invention.

[0018]FIG. 4B depicts another exemplary mapping function according to an embodiment of the present invention.

[0019]FIG. 4C depicts another exemplary mapping function according to an embodiment of the present invention.

[0020]FIG. 5 depicts an exemplary block diagram of a texture rendering system according to embodiments of the present invention.

[0021]FIG. 6 depicts an exemplary flowchart according to embodiments of the present invention.

[0022]FIG. 7 depicts a block diagram of a computer system on which embodiments of the present invention may be implemented.

DETAILED DESCRIPTION OF THE INVENTION

[0023] Embodiments of the present invention are related to a system and method for enhancing an image produced by parametric texture mapping (PTM). PTM is a computer algorithm for rendering objects using a two-dimensional representation of light. PTM is desirable because it produces quite realistic images based on material properties while possessing reasonable computational complexity. Additionally, it shall be appreciated that the PTM algorithm does not require complex geometric modeling. Instead, optical properties are encoded directly into the texture itself. By placing illumination-dependent information into the texture, PTM algorithms are capable of producing enhanced optical effects while reducing computational complexity.

[0024] In PTM, each texel of the texture contains lighting information. The lighting information is used to reconstruct the surface color under varying light conditions. PTM textures permit perception of surface deformations. Additionally, PTM textures permit perception of self-shadowing and interreflections. PTM textures may also simulate other optical effects such as anisotropic and Frensel shading models.

[0025] In PTM, each texel is defined by a biquadric function with six coefficients. Each texel is represented by the following form:

PTM(u,v)=Au ² +Bv ² +Cuv+Du+Ev+F,

[0026] where u and v represent scalar quantities associated with orthogonal components of a vector. For example, u and v may represent the intensity of light from two different directions where the texel is rendered on the three-dimensional object. Specifically, a light source is first determined to be illuminating the three-dimensional object or model. The light source is defined as being positioned at a location relative to the texel being illuminated in the direction defined by illumination vector, {right arrow over (L)}. Illumination vector, {right arrow over (L)}, is typically a unit vector. Secondly, surface normal vector, {right arrow over (S)}. (which is the unit vector that is normal to the surface of the three-dimensional object where the texel is to be applied) is determined. The projection of illumination vector, {right arrow over (L)}, onto the plane defined by surface normal vector, {right arrow over (S)}, is determined. The projection is represented as two orthogonal vector components on the plane defined by surface normal vector, {right arrow over (S)}. The two orthogonal vector components are respectively associated with the scalar values, u and v.

[0027] To aid the reader's understanding of the vector concepts, reference is now made to FIG. 3 which depicts exemplary plane 301 associated with a texel, surface normal vector, {right arrow over (S)}, and illumination vector, {right arrow over (L)}. As is well known in the art, plane 301 is defined by a position and surface normal vector, {right arrow over (S)}. The unit vectors {right arrow over (i)} and {right arrow over (j)} are mutually orthogonal on plane 301. Unit vectors {right arrow over (i)} and {right arrow over (j)} are also orthogonal to surface normal vector, {right arrow over (S)}. by definition. {right arrow over (L)}_(p) is the projection of illumination vector, {right arrow over (L)}, onto plane 301. {right arrow over (L)}_(p) is composed of components (u{right arrow over (i)}, v{right arrow over (j)}), where u and v are the scalar values of {right arrow over (L)}_(p) in the {right arrow over (i)} and {right arrow over (j)} directions, respectively.

[0028] The coefficients of the texel representation equation, A-F, of the PTM texture may be determined by repeatedly sampling a surface. For example, a physical stone surface may be digitally photographed a number of times utilizing different illumination angles. The coefficients, A-F, may then be determined from the digital information utilizing a least square approximation. Singular value decomposition (SVD) may be utilized to perform this analysis. Further details regarding implementation of PTM algorithms are disclosed in U.S. patent application Ser. No. 09/528,700, entitled “APPARATUS FOR AND METHOD OF RENDERING 3D OBJECTS WITH PARAMETRIC TEXTURE MAPS.”

[0029] In some embodiments of the present invention, the PTM function defines the brightness of a texel and the chromaticity is held constant, i.e., a single PTM function is utilized for all of the red, green, and blue (RGB) chromatic components or channels. However, it shall be appreciated that separate functions may be defined for RGB chromatic components or channels. The separate functions may be used to calculate gray-level intensities of the RGB channels. According to this approach, three separate functions are each evaluated according to u and v as determined by the same surface normal vector, {right arrow over (S)}, and the same illumination vector, {right arrow over (L)}. However, it is advantageous to cause the chromaticity to remain independent of u and v, because this approach reduces the computational complexity of the algorithm.

[0030] It shall be appreciated that PTM provides appreciable advantages over other texture mapping techniques. In particular, PTM does not require modeling the complex geometry structures. PTM textures are much more easily constructed from real world samples (e.g., photographs) than bump maps. Moreover, PTM textures provide greater realism than bump maps due to PTM's ability to model complex optical effects.

[0031] Although PTM provides a relatively high degree of realism, PTM does possess certain limitations. First, the digital information collected via photographic sampling is necessarily affected by the light utilized to illuminate the physical sample surface. For example, if a blue-tinted light was utilized, the PTM function will be affected by the blue tint. Second, the two-dimensional parameterization of the light (u, v) does not differentiate between front-facing light and back-facing light. Also, objects rendered using PTM textures do not possess ambient light properties.

[0032] In embodiments of the present invention, a one-dimensional light texture is preferably provided to modulate the PTM function to address the limitations discussed above. The one-dimensional light texture may be defined by a function of the dot product between illumination vector, {right arrow over (L)}, and surface normal vector, {right arrow over (S)}. The dot product, p, between illumination vector, {right arrow over (L)}, and surface normal vector, {right arrow over (S)}, is bounded by −1 and 1, because both {right arrow over (L)} and {right arrow over (S)} are unit vectors. If {right arrow over (L)} and/or {right arrow over (S)} are not defined as unit vectors for a particular application, the normalized dot product may be utilized which equals:

{right arrow over (S)}·{right arrow over (L)}/|{right arrow over (S)}||{right arrow over (L)}|

[0033]FIG. 4A depicts exemplary function 401 which may be used to define the one-dimensional light texture for embodiments of the present invention. Function 401 is a step function of p, i.e., it equals zero for p<0 and it equals one for p≧0. By multiplying or modulating the PTM function by function 401 evaluated at p, it is possible to differentiate between front-facing and back-facing light. Specifically, when the illumination light defined by illumination vector, {right arrow over (L)}, is back-facing, the PTM function is multiplied by zero. Hence, no illumination is provided to the texel is this situation. However, when the illumination light is front-facing, the PTM function is multiplied by one. By modulating the PTM function in this manner, it is possible to differentiate between front-facing and back-facing illumination light.

[0034]FIG. 4B depicts another exemplary function 402 which may be used to define the one-dimensional light texture for embodiments of the present invention. As shown, function 402 equals zero for p<0. However, function 402 does not experience as abrupt a change as function 401. Instead, function 402 is a ramp function from p=0 to p=a. For p>a, function 402 equals one. Although function 402 utilizes a linear ramp between p=0 and p=a, other functions may be utilized. As examples, a polynomial function or an exponential function may be utilized to transition from the minimum and maximum values if desired. Utilizing suitable ramping functions, the transition from back-facing to front-facing illumination is provided in a relatively smooth manner. By modulating the PTM function in this manner, it is possible to model low-angle illumination phenomenon with a greater degree of realism.

[0035]FIG. 4C depicts yet another exemplary function 403 that may be used to define the one-dimensional light texture for embodiments of the present invention. Function 403 is similar to function 402. However, function 403 is equal to the minimum value, b>0, for p<0. The minimum value, b, represents an ambient light property. The ambient light property causes a certain amount of light to be associated with the texel even if the illumination light is back-facing.

[0036] In embodiments of the present invention, the synthesis process preferably utilizes a non-white light source. It shall be appreciated that the illumination light utilized by PTM is typically a white light. In other words, the illumination source associated with illumination vector, {right arrow over (L)}, is assumed to emit illumination possessing substantially equal intensities of red, green, and blue spectral components. However, embodiments of the present invention preferably define RGB illumination parameters. The RGB parameters define the relative intensity of the various color channels of the illumination light. The PTM function value for a particular color channel may be modulated by the respective RGB parameter. By modulating with the RGB parameters, the illumination light may be varied as desired. For example, if a red-tinted illumination source is desired, the red parameter may be weighted more heavily that the green and blue parameters. By utilizing RGB parameters, embodiments of the present invention may define synthesis illumination tinted according to any arbitrary spectral composition.

[0037] It shall be appreciated that modulation by evaluating functions 401, 402, and 403 does not encompass appreciable computational complexity. In particular, the operations may be performed by a few multiplication operations and a table look-up. Accordingly, embodiments of the present invention are capable of providing enhanced optical effects to PTM textures without appreciably affecting rendering efficiency.

[0038]FIG. 5 depicts a block diagram of an exemplary system 500 adapted according to embodiments of the present invention. Exemplary system 500 comprises rendering algorithm 501. Rendering algorithm 501 utilizes three-dimensional model 502 as the basis for the wrapping functionality. For example and not by way of limitation, three-dimensional model 502 may contain vertexes information as previously described with respect to object 101 of FIG. 1A. Rendering algorithm 501 also utilizes PTM texture map 503, modulation function (or table) 504, and illumination source 505 to wrap the texels onto the surfaces of the three-dimensional object to produce two-dimensional texture map image 506. PTM texture map 503 may be implemented as a data structure stored in memory. Modulation function 504 may be implemented as a data structure (e.g., a class, a table, or an array) or logical instructions which map an illumination parameter to a modulation value. Illumination source 505 may be implemented as a data structure. Illumination source 505 may define vector components of the illumination. Illumination source 505 may also define RGB parameters to tint the illumination as desired.

[0039]FIG. 6 depicts exemplary flowchart 600 according to embodiments of the present invention. Flowchart 600 comprises exemplary steps which may be performed by rendering algorithm 501 to generate texture mapped image 506. Flowchart 600 begins with step 601 where a texel is selected from a PTM texture 503. The position where the texel is to be placed on the three-dimensional model is determined in step 602 through conventional texture mapping techniques. Specifically, surface normal vector, {right arrow over (S)}. is determined in step 603. However, according to the present invention, the dot product between illumination vector, {right arrow over (L)}, defined by illumination source 505, and surface normal vector, {right arrow over (S)}, is calculated in step 604. In step 605, the function value (via function 401, 402, 403 or other suitable function) is determined by utilizing the value of the dot product. As previously noted, the function value allows differentiation between front-facing and back-facing light and allows perception of ambient light. In step 606, the function value is multiplied by the respective RGB parameter to produce the modulation value. For example, if the red component or channel of the texel is being rendered, the function value is multiplied by the red parameter. As previously noted, the RGB parameters allow the illumination light to be tinted as desired. In step 607, u and v are calculated from the projection of illumination vector, {right arrow over (L)}, onto the plane defined by surface normal vector, {right arrow over (S)}. In step 608, the value of PTM(u, v) is calculated. In step 609, the value of PTM(u, v) is multiplied by the modulation value (the result of step 606). Step 609 produces the modulated PTM value. The modulated PTM value is utilized to render a pixel on a computer graphics image.

[0040] When implemented via executable instructions, various elements of the present invention are, in essence, the code defining the operations of such various elements. The executable instructions or code may be obtained from a readable medium (e.g., a hard drive media, optical media, EPROM, EEPROM, tape media, cartridge media, flash memory, ROM, memory stick, and/or the like) or communicated via a data signal from a communication medium (e.g., the Internet). In fact, readable media may include any medium that may store or transfer information.

[0041]FIG. 7 illustrates exemplary computer system 700 adapted according to embodiments of the present invention. Central processing unit (CPU) 701 is coupled to system BUS 702. CPU 701 may be any general purpose CPU. Suitable processors, without limitation, include any processor from the Itanium family of processors or a PA-8500 processor available from Hewlett-Packard Company. However, the present invention is not restricted by the architecture of CPU 701 as long as CPU 701 supports the inventive operations as described herein. Computer system 700 includes BUS 702. Computer system 700 also includes random access memory (RAM) 703, which may be, for example, SRAM, DRAM, or SDRAM. Computer system 700 includes ROM 704 which may be PROM, EPROM, or EEPROM. RAM 703 and ROM 704 hold user and system data and programs as is well-known in the art.

[0042] Computer system 700 also includes input/output (I/O) adapter 705, communications adapter 711, user interface adapter 708, and display adapter 709. I/O adapter 705 connects to storage devices 706, such as one or more of hard drive, CD drive, floppy disk drive, tape drive, to computer system 700. Communications adapter 711 is adapted to couple computer system 700 to network 712, which may be one or more of telephone network, local (LAN) and/or wide-area (WAN) network, Ethernet network, and/or Internet network. User interface adapter 708 couples user input devices, such as keyboard 713 and pointing device 707, to computer system 700. Display adapter 709 is driven by CPU 701 to control the display on display device 710.

[0043] Although embodiments of the present invention have been described as being implemented in software instructions, it shall be appreciated that the present invention is not so limited. Embodiments of the present invention may be implemented on application specific integrated circuits (ASIC) or very large scale integrated (VLSI) circuits. In fact, persons of ordinary skill in the art may utilize any number of suitable structures capable of executing logical operations according to the embodiments of the present invention. Additionally, it shall be appreciated that the present invention is not limited to the architecture of computer system 700. Any suitable processor-based device may be utilized including, without limitation, personal data assistants (PDAs), computer game consoles, and multi-processor servers.

[0044] Embodiments of the present invention provide several advantages. First, embodiments of the present invention enable the use of PTM techniques to achieve an appreciable amount of realism to graphical images. Embodiments of the present invention enable PTM techniques to render graphical images by differentiating between back-facing and forward-facing light to achieve a greater degree of realism. Also, embodiments of the present invention enable a gradual visual transition between back-facing and front-facing lighting effects to achieve greater realism. Embodiments of the present invention enable ambient light effects to be rendered utilizing PTM techniques. Moreover, embodiments of the present invention enable the illumination light to be tinted according to any desired spectral composition. 

1. A system for rendering a pixel of a digital image, said system comprising: a texture map data structure representing a texture map of a plurality of texels, said texture map structure comprising a plurality of coefficients for each texel of said texture map, said plurality of coefficients defining lighting characteristics of the respective texel in response to illumination in a plane; a modulation data structure, said modulation data structure defining a range of values associated with an illumination vector; and a rendering algorithm, said rendering algorithm operable to calculate a texel display value using said texture map data structure, said rendering algorithm operable to determine an illumination modulation value from said modulation data structure, and said rendering algorithm operable to multiply said texel display value by said illumination modulation value to render a pixel.
 2. The system of claim 1 wherein said illumination in said plane is defined by two scalar parameters, wherein each of said scalar parameters reflects intensity of illumination in a direction in said plane, and wherein the directions associated with said scalar parameters are orthogonal to each other.
 3. The system of claim 2 wherein a first one of said two scalar parameters is represented by u, wherein a second one of said two scalar parameters is represented by v, and wherein said rendering algorithm calculates said texel display value utilizing six coefficients from said texture map data structure utilizing an equation of the following form: Au ² +Bv ² +Cuv+Du+Ev +F.
 4. The system of claim 1 wherein said modulation data structure maps illumination vectors associated with back-facing illumination to a minimum illumination modulation value.
 5. The system of claim 4 wherein said minimum illumination modulation value is zero.
 6. The system of claim 4 wherein said minimum illumination modulation value is greater than zero.
 7. The system of claim 1 wherein said modulation data structure maps illumination vectors associated with front-facing light to a maximum value.
 8. The system of claim 4 wherein said modulation data structure maps at least one illumination vector associated with front-facing light to a maximum value.
 9. The system of claim 8 wherein said modulation data structure maps certain illumination vectors to ramp values between said minimum value and said maximum value.
 10. The system of claim 1 further comprising: an illumination data structure, wherein said illumination data structure comprises chromatic parameters associated with a light source.
 11. A method for rendering a pixel of digital image, said method comprising: providing a texture map including a plurality of texels; determining a plane associated with a texel of said plurality of texels; determining a surface normal vector to said plane; determining a light vector defining illumination of said texel; calculating scalar vector components associated with projection of said light vector onto said plane; calculating a display value for said texel utilizing at least said scalar vector components; determining a modulation value utilizing a dot product of said light vector and said surface normal vector; and multiplying said display value by said modulation value to render a pixel.
 12. The method of claim 11 wherein said display value represents a brightness parameter.
 13. The method of claim 11 wherein said display value represents a gray level intensity of a chromatic channel of said texel.
 14. The method of claim 11 wherein said scalar vector components are represented by u and v, and wherein said step of calculating a display value utilizes a function in the form of: Au ² +Bv ² +Cuv+Du+Ev+F.
 15. The method of claim 11 wherein said step of determining a modulation value assigns a minimum value when said light vector is in a direction opposite to said surface normal vector.
 16. The method of claim 15 wherein said minimum value is zero.
 17. The method of claim 15 wherein said minimum value is greater than zero.
 18. The method of claim 11 wherein said step of determining a modulation value assigns a maximum value when said light vector is in a common direction as said surface normal vector.
 19. The method of claim 11 wherein said step of determining a modulation value assigns ramp values between a minimum value and a maximum value.
 20. The method of claim 11 further comprising the step of: multiplying said display value by a chromatic parameter.
 21. A computer readable medium containing processor executable instructions, said computer readable medium comprising: code for calculating a display value of a texel of a texture, said texture being defined by a parametric texture map algorithm; code for determining a modulation value by mapping a dot product of an illumination vector and a surface normal vector associated with said texel; and code for multiplying said display value by said modulation value.
 22. The computer readable medium of claim 21 wherein said code for determining maps back-facing illumination to a minimum value.
 23. The computer readable medium of claim 22 wherein said minimum value is zero.
 24. The computer readable medium of claim 22 wherein said minimum value is greater than zero.
 25. The computer readable medium of claim 21 wherein said code for determining maps front-facing illumination to a maximum value.
 26. The computer readable medium of claim 21 wherein said code for determining maps predefined dot product values to ramp values between a minimum value and a maximum value.
 27. The computer readable medium of claim 21 further comprising: code for multiplying said display value by a chromatic parameter. 